<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('提现申请信息')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-shop-apply-edit" th:object="${shopApply}">
        <h4 class="form-header h4">提现申请</h4>
        <div class="row">
            <div class="col-sm-offset-4 col-sm-12">
                <button type="button" class="btn btn-sm btn-primary" onclick="pass()" th:if="${shopApply.status eq 0}" ><i class="fa fa-check"></i>通 过</button>&nbsp;
                <button type="button" class="btn btn-sm btn-warning" onclick="reject()" th:if="${shopApply.status eq 0}"><i class="fa fa-edit"></i>拒 绝</button>
            </div>
        </div>
        <input name="id" th:field="*{id}" type="hidden">
        <h4 class="form-header h4">基本信息</h4>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">提现方式：</label>
                    <div class="col-sm-8" style="align-items: center; justify-content: center;padding-top:7px">
                        <span class='badge badge-info' th:if="${shopApply.applyType eq 0}">微信</span>
                        <span class='badge badge-info' th:if="${shopApply.applyType eq 1}">支付宝</span>
                        <span class='badge badge-info' th:if="${shopApply.applyType eq 2}">银行卡</span>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label"> 申请状态 </label>
                    <div class="col-sm-8" style="align-items: center; justify-content: center;padding-top:7px">
                        <span class='badge badge-info' th:if="${shopApply.status eq 0}">申请中</span>
                        <span class='badge badge-warning' th:if="${shopApply.status eq 1}">拒绝</span>
                        <span class='badge badge-success' th:if="${shopApply.status eq 2}">已通过</span>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">申请商户名称：</label>
                    <div class="col-sm-8">
                        <input name="shopName" th:value="${shopApply.businessShop.name}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">申请金额：</label>
                    <div class="col-sm-8">
                        <input name="balance" th:field="*{balance}" class="form-control" type="text" required  readonly="true">
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">申请时间：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            <input name="createTime" th:value="${#dates.format(shopApply.createDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" readonly="true">
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-sm-6">
                <div class="form-group">
                    <label class="col-sm-4 control-label">修改时间：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                            <input name="updateTime" th:value="${#dates.format(shopApply.modifyDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" readonly="true">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-2 control-label">备注：</label>
            <div class="col-xs-10">
                <textarea name="remark" maxlength="500" class="form-control" rows="3">[[*{remark}]]</textarea>
            </div>
        </div>
        <h4 class="form-header h4">商家信息</h4>
        <div class="form-group">
            <label class="col-sm-3 control-label">店铺名称：</label>
            <div class="col-sm-8">
                <input name="businessShopId"  class="form-control" type="text" th:value="${shop.name}" readonly="true">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">店铺电话：</label>
            <div class="col-sm-8">
                <input name="businessPhone"  class="form-control" type="text" th:value="${shop.phone}" readonly="true">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">店铺余额：</label>
            <div class="col-sm-8">
                <input name="shopBalance"  class="form-control" type="text" th:value="${shopInfo.balance}" readonly="true">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script type="text/javascript">
    var prefix = ctx + "normal/apply";
    $("#form-shop-apply-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-shop-apply-edit').serialize());
        }
    }

    function pass(){
        $.operate.save(prefix + "/pass", $('#form-shop-apply-edit').serialize());
    }

    function reject(){
        $.operate.save(prefix + "/reject", $('#form-shop-apply-edit').serialize());
    }


    $("input[name='createDate']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>